# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=python2-natsort
_pkgname=natsort
pkgver=6.2.0
pkgrel=2
pkgdesc='Simple yet flexible natural sorting in Python.'
url='https://pypi.org/project/natsort/#files'
arch=('any')
license=('MIT')
depends=('python2')
makedepends=('python2-setuptools')
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz")
sha512sums=('a8bfa0182c21e6edfde331545d02a0ebcfef387c6e6785e8197f14acffebbee82bc5bbdb807c9a72cc721861c66c3107dfad61385d244e003c2352d46e019a30')

build() {
  cd "$_pkgname-$pkgver"

  python2 setup.py build
}

package() {
  cd "$_pkgname-$pkgver"

  python2 setup.py install --root="$pkgdir" --prefix=/usr -O1 --skip-build

  mv "$pkgdir/usr/bin/$_pkgname" "$pkgdir/usr/bin/${_pkgname}2"
}

